/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "Routing")
@NamedQueries({
    @NamedQuery(name = "Routing.findAll", query = "SELECT r FROM Routing r"),
    @NamedQuery(name = "Routing.findByRouteID", query = "SELECT r FROM Routing r WHERE r.routeID = :routeID"),
    @NamedQuery(name = "Routing.findByActiveDescription", query = "SELECT r FROM Routing r WHERE r.activeDescription = :activeDescription"),
    @NamedQuery(name = "Routing.findByOderNumber", query = "SELECT r FROM Routing r WHERE r.oderNumber = :oderNumber")})
public class Routing implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "routeID")
    private Integer routeID;
    @Column(name = "activeDescription")
    private String activeDescription;
    @Column(name = "oderNumber")
    private Integer oderNumber;
    @JoinColumn(name = "scheduleID", referencedColumnName = "scheduleID")
    @ManyToOne(optional = false)
    private TourSchedule tourSchedule;
    @JoinColumn(name = "hoteID", referencedColumnName = "hoteID")
    @ManyToOne
    private Hotel hotel;
    @JoinColumn(name = "cityID", referencedColumnName = "cityID")
    @ManyToOne
    private City city;

    public Routing() {
    }

    public Routing(Integer routeID) {
        this.routeID = routeID;
    }

    public Integer getRouteID() {
        return routeID;
    }

    public void setRouteID(Integer routeID) {
        this.routeID = routeID;
    }

    public String getActiveDescription() {
        return activeDescription;
    }

    public void setActiveDescription(String activeDescription) {
        this.activeDescription = activeDescription;
    }

    public Integer getOderNumber() {
        return oderNumber;
    }

    public void setOderNumber(Integer oderNumber) {
        this.oderNumber = oderNumber;
    }

    public TourSchedule getTourSchedule() {
        return tourSchedule;
    }

    public void setTourSchedule(TourSchedule tourSchedule) {
        this.tourSchedule = tourSchedule;
    }

    public Hotel getHotel() {
        return hotel;
    }

    public void setHotel(Hotel hotel) {
        this.hotel = hotel;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (routeID != null ? routeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Routing)) {
            return false;
        }
        Routing other = (Routing) object;
        if ((this.routeID == null && other.routeID != null) || (this.routeID != null && !this.routeID.equals(other.routeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.Routing[routeID=" + routeID + "]";
    }

}
